import { BASE_NAME } from '@/library/tool-kits/get-process-env'
import { setRediectPath } from '@/library/tool-kits/handler-token'
import { authenticationPaths } from '@/pages/authentication/paths'
import { history } from '../history'

export const reLogin = (): void => {
  const basename = BASE_NAME !== '/' ? BASE_NAME : ''
  const reg = new RegExp(basename)
  const pt = history.location.pathname.replace(reg, '')
  setRediectPath(pt)
  // store.dispatch(authenticationLogoutActionFn())
  history.push(basename + authenticationPaths['$$.login'])
}
